home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 385 / prg_1 / prg_1bp.s < prev    next >
Text File  |  1985-11-19  |  1KB  |  29 lines

  1.  ; Program Name: PRG_1BP.S
  2.  
  3.  ; Assembly Instructions:
  4.  
  5.  ;    Assemble in AssemPro PC-relative mode and save the assembled program
  6.  ; with a PRG extension, then save it with a TOS extension.
  7.  
  8.  ; Program Function:
  9.  
  10.  ;    This program waits until a key is pressed on the keyboard.  When
  11.  ; that event occurs, it returns control to the operating system.
  12.  
  13.  ; NOTE: This program cannot be executed repeatedly in the debugger unless
  14.  ;       the S bit of the status register is reset after each execution.
  15.  ;       If the S bit is not reset as stated, the system will freeze, and
  16.  ;       must be reset with the computer's reset switch.
  17.  
  18. wait_for_keypress: 
  19.  move.w     #8, -(sp)           ; Function = c_necin = GEMDOS $8.
  20.  trap       #1                  ; GEMDOS call.
  21.  addq.l     #2, sp              ; Reposition stack pointer at top of stack.
  22.  
  23. terminate:                      ; My descriptive label.
  24.  move.w    #0, -(sp)            ; Function = p_term_old = GEMDOS $0.
  25.  trap      #1                   ; GEMDOS call.
  26.  
  27.  end                            ; Assembler pseudo-op.
  28.  
  29.